package com.dq.controller.op.opboss.config;

import com.dq.exception.customException.AdminException;
import com.dq.controller.in.OrgTemplateRequest;
import com.dq.vo.Vo;
import com.dq.service.AllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Author luchangtong
 * @Date 2020/3/17 17:00
 */
@Api(description = "门店设置默认模版")
@RestController
@RequestMapping("sys/boss/bossOrgTemplate/")
public class BossOrgTemplateController extends AllService {

    @ApiOperation("获取门店默认评分模板信息")
    @GetMapping("/list")
    public Vo list()throws AdminException{

        return orgTemplateService.list();
    }

    @ApiOperation("新增门店默认评分模板信息")
    @PostMapping("/add")
    public Vo add (@RequestBody OrgTemplateRequest orgTemplateRequest) throws AdminException{

        return orgTemplateService.saveOrgTemplate(orgTemplateRequest);
    }

    @ApiOperation("编辑门店默认评分模板信息")
    @PostMapping("/edit")
    public Vo edit(@RequestBody OrgTemplateRequest orgTemplateRequest) throws AdminException{

        return orgTemplateService.editOrgTemplate(orgTemplateRequest);
    }

    @ApiOperation("删除门店默认评分模板信息")
    @PostMapping("/delete")
    public Vo delete() throws AdminException{
        return orgTemplateService.delOrgTemplate();
    }
}
